import { QuestionProps } from "@/api/question";
import Title from "../Title";
import { Container, Box } from "../shortAnswer/styled";
import JsBox from "../jsBox";

export default function CodeAswer({
  handleCheck,
  value,
  index,
  data,
}: QuestionProps) {
  const {_id, type, question, description } = data;
  console.log(data, 1111);
  
  return (
    <Container>
      <Title type={type} index={index} title={question} />
      <Box>
        <JsBox
          description={description}
          codeVal={value as string}
          handleChange={handleCheck}
          _id={_id}
        />
        {/* <MDEditor value={value as string} height="350px" onChange={handleChange} /> */}
        {/* <MDEditor.Markdown source={value} style={{ whiteSpace: "pre-wrap" }} /> */}
      </Box>
    </Container>
  );
}
